home *** CD-ROM | disk | FTP | other *** search
/ MacPeople 1998 #2 / MACPEOPLE-1998-NO2.ISO / アップル関連 / ARA PS アップデート / モデム用 / ARA 2.0 用 GV Platinum / ARA 2.0 óp GV Platinum next >
Text File  |  1995-06-12  |  8KB  |  431 lines

  1. !  Global Village Teleport Gold & Powerport Gold  6/29/93  KW
  2. !
  3. !  'mlts' resource info for this modem:
  4. !    byte 1 == 01 -> modem HAS builtin reliability protocols
  5. !    byte 2 == 00 -> reserved by Apple
  6. !    byte 3 == 21 -> max hex chars in varstr 7 (33 dec)
  7. !    byte 4 == 21 -> max hex chars in varstr 8
  8. !    byte 5 == 21 -> max hex chars in varstr 9
  9. !    
  10. !    29Aug93    rhoiberg    Changed all commands to capitals.  Stop using the SBreak command
  11. !                        it seems to be wedging the modems.  Change &D0 to &D3.  Clean up the Hangup command 
  12. !                        and make the +++ sequence work when on line.  Turn off answer in hangup by 
  13. !                        setting S0=0 in @HANGUP.
  14. ! 02/14/94 SAP Changes to work with all GV Modems except TP BronzeII 
  15. !              PP Bronze
  16. !
  17. !     2jun94    rhoiberg    Moved the userhook 1 from when a ring happens to when it 
  18. !                        really gets connected.  This fixes the bug where a fax is received
  19. !                        and the serial port is marked as busy and can no longer be used.
  20. ! 12/02/94 SAP Made changes to support Platinum
  21. ! 01/05/94 crw Made changes to support fax/ARA discrimination
  22. !
  23. @ORIGINATE
  24. @ANSWER
  25. !
  26. ! set up the modem - label range is 1-10
  27. !
  28. ! Mac talks to the modem at 19,200 bps.  
  29. serreset 19200, 0, 8, 1
  30. !
  31. ! reset the serial port
  32. HSReset 0 0 0 0 0 0
  33. settries 0
  34. @LABEL 1
  35. ifANSWER 3                    
  36. !
  37. ! Mac talks to the modem at 57,600 bps.
  38. serreset 57600, 0, 8, 1            
  39. !
  40. @LABEL 3
  41. matchclr
  42. matchstr 1 4 "OK¥13¥10"
  43. ! &F1  - recall factory settings
  44. ! &D3 - Reset Modem on On-to-Off DTR transitions
  45. ! W2  - Connect result code reports modem speed
  46. ! S7=60 - To allow for an international call
  47. ! S0=0 - Don't answer calls
  48. ! E0   - Turn command echo off
  49. ! ¥N0 - Enter normal mode (no reliability protocols)
  50. write "AT&F1&D3W2S7=60S0=0E0¥¥N0¥13"
  51. matchread 30
  52. inctries
  53. iftries 2 71
  54. !
  55. ! Reset the Modem
  56. !
  57. DTRSet
  58. pause 5
  59. DTRClear
  60. pause 5
  61. DTRSet
  62. flush
  63. jump 1
  64. !
  65. @LABEL 4
  66. ! Modem responding & configured.
  67. ! determine if reliable link is requested.
  68. !
  69. ! if modem mnp10 link requested (var 4 == 2) then jump label 5
  70. ifstr 4 5 "2"
  71. !
  72. ! if no modem v42 link requested (var 4 == 0) [same as ARA 1.0] then jump label 9
  73. ifstr 4 9 "0"
  74. !
  75. ! else invalid value in var 4; exit w/error
  76. jump 76
  77. !
  78. @LABEL 5
  79. ! use this label for mnp 10 type stuff...
  80. ! THIS modem doesn't support mnp 10 links.
  81. jump 9
  82. !
  83. @LABEL 9
  84. ! If speaker on flag is true, jump to label 13.  Else turn off the speaker.
  85. ifstr 2 13 "1"
  86. pause 5
  87. matchclr
  88. matchstr 1 13 "OK¥13¥10"
  89. write "ATM0¥13"
  90. matchread 30
  91. jump 71
  92. !
  93. ! modem ready, so enable answering or originate a call - label range is 11-30
  94. !
  95. @LABEL 13
  96. pause 5
  97. ifANSWER 62
  98. !
  99. ! if normal dialing (parm 6 == 0) jump to 19
  100. ifstr 6 19 "0"
  101. !
  102. ! if blind dialing (parm 6 == 1) jump to 17
  103. ifstr 6 17 "1"
  104. !
  105. ! if manual dialing (parm 6 == 2) jump to 15 
  106. ifstr 6 15 "2"
  107. !
  108. ! else invalid value in var 6; exit w/error
  109. jump 76
  110. !
  111. @label 15
  112. note "Manual dialing initiated" 3
  113. ! X1 to ignore dialtone & busy for manual dialing, D to dial
  114. write "ATX1D ¥13"
  115. jump 32
  116. !
  117. @label 17
  118. note "Dialing without tone" 3
  119. matchclr
  120. matchstr 1 19 "OK¥13¥10"
  121. ! X1 to ignore dialtone & busy for blind dialing
  122. write "ATX1¥13"
  123. matchread 30
  124. jump 71
  125. !
  126. @label 19
  127. ! this is where we break up long dialstrings
  128. !
  129. ! parm 1 is always the full dialstring from the conn doc
  130. note "Dialing ^1" 3
  131. ! parm 3 is always "p" for pulse & "t" for tone
  132. !
  133. ! if parm 8 == blank (complete dialstring in parm 7)
  134. !  then jump to label 27 & dial parm 7
  135. ifstr 8 27 " "
  136. !
  137. ! if parm 9 == blank (complete dialstring in parms 7 & 8)
  138. !  then jump to label 24 & dial parm 7 & 8
  139. ifstr 9 24 " "
  140. !
  141. !  else dial parm 7 & 8 & 9 (complete dialstring in parms 7, 8 & 9)
  142. matchclr
  143. matchstr 1 21 "OK¥13¥10"
  144. ! parm 7 holds first string fragment
  145. write "ATD^3^7;¥13"
  146. matchread 400
  147. ! modem not responding; bailout.
  148. jump 71
  149. @label 21
  150. ! parm 8 holds second string fragment
  151. matchclr
  152. matchstr 1 22 "OK¥13¥10"
  153. write "ATD^3^8;¥13"
  154. matchread 400
  155. ! modem not responding; bailout.
  156. jump 71
  157. @label 22
  158. ! parm 9 holds last string fragment
  159. write "ATD^3^9¥13"
  160. jump 32
  161. !
  162. @label 24
  163. matchclr
  164. matchstr 1 25 "OK¥13¥10"
  165. ! parm 7 holds first string fragment
  166. write "ATD^3^7;¥13"
  167. matchread 400
  168. ! modem not responding; bailout.
  169. jump 71
  170. @label 25
  171. ! parm 8 holds last string fragment
  172. write "ATD^3^8¥13"
  173. jump 32
  174. !
  175. @label 27
  176. ! parm 7 holds entire string
  177. write "ATD^3^7¥13"
  178. jump 32
  179. !
  180. !    connecting - label range is 31-60
  181. !
  182. @LABEL 32
  183. matchclr
  184. matchstr 1  34 "CONNECT 1200¥13¥10"
  185. matchstr 2  35 "CONNECT 2400¥13¥10"
  186. matchstr 3  36 "CONNECT 4800¥13¥10"
  187. matchstr 4  37 "CONNECT 7200¥13¥10"
  188. matchstr 5  38 "CONNECT 9600¥13¥10"
  189. matchstr 6  39 "CONNECT 12000¥13¥10"
  190. matchstr 7  40 "CONNECT 14400¥13¥10"
  191. matchstr 8  41 "CONNECT 16800¥13¥10"
  192. matchstr 9  42 "CONNECT 19200¥13¥10"
  193. matchstr 10 43 "CONNECT 21600¥13¥10"
  194. matchstr 11 44 "CONNECT 24000¥13¥10"
  195. matchstr 12 45 "CONNECT 26400¥13¥10"
  196. matchstr 13 46 "CONNECT 28800¥13¥10"
  197. matchstr 14 50 "RING¥13¥10"
  198. matchstr 15 51 "FAX¥13¥10"
  199. matchstr 16 53 "DATA¥13¥10"
  200. matchstr 17 72 "NO DIALTONE¥13¥10"
  201. matchstr 18 73 "NO CARRIER¥13¥10"
  202. matchstr 19 73 "ERROR¥13¥10"
  203. matchstr 20 74 "BUSY¥13¥10"
  204. matchstr 21 75 "NO ANSWER¥13¥10"
  205. matchread 700
  206. ifANSWER 32
  207. jump 71
  208. !
  209. !  THIS v32b modem has been setup to do duplex cts/rts handshaking,
  210. !  and we assume that a cts/rts handshaking cable is being used,
  211. !  so we leave the serial port set to 19,200 bps.
  212. !  
  213. !  in a v32 or v22b modem, we assume the lower data rate won't require
  214. !  cts/rts handshaking.  
  215. !
  216. @LABEL 34
  217. note "Communicating at 1200 bps." 2
  218. CommunicatingAt 1200
  219. jump 58
  220. !
  221. @LABEL 35
  222. note "Communicating at 2400 bps." 2
  223. CommunicatingAt 2400
  224. jump 58
  225. !
  226. @LABEL 36
  227. note "Communicating at 4800 bps." 2
  228. CommunicatingAt 4800
  229. jump 58
  230. !
  231. @LABEL 37
  232. note "Communicating at 7200 bps." 2
  233. CommunicatingAt 7200
  234. jump 58
  235. !
  236. @LABEL 38
  237. note "Communicating at 9600 bps." 2
  238. CommunicatingAt 9600
  239. jump 58
  240. !
  241. @LABEL 39
  242. note "Communicating at 12000 bps." 2
  243. CommunicatingAt 12000
  244. jump 58
  245. !
  246. @LABEL 40
  247. note "Communicating at 14400 bps." 2
  248. CommunicatingAt 14400
  249. jump 58
  250. !
  251. @LABEL 41
  252. note "Communicating at 16800 bps." 2
  253. CommunicatingAt 16800
  254. jump 58
  255. !
  256. @LABEL 42
  257. note "Communicating at 19200 bps." 2
  258. CommunicatingAt 19200
  259. jump 58
  260. !
  261. @LABEL 43
  262. note "Communicating at 21600 bps." 2
  263. CommunicatingAt 21600
  264. jump 58
  265. !
  266. @LABEL 44
  267. note "Communicating at 24000 bps." 2
  268. CommunicatingAt 24000
  269. jump 58
  270. !
  271. @LABEL 45
  272. note "Communicating at 26400 bps." 2
  273. CommunicatingAt 26400
  274. jump 58
  275. !
  276. @LABEL 46
  277. note "Communicating at 28800 bps." 2
  278. CommunicatingAt 28800
  279. jump 58
  280. !
  281. !
  282. @LABEL 50
  283. ifORIGINATE 32
  284. note "Answering phone..."        
  285. jump 32
  286. !
  287. @LABEL 51                        
  288. note "Answering fax call..."
  289. matchclr
  290. matchstr 1 52 "CONNECT¥13¥10"    
  291. matchread 100                    
  292. jump 71                            
  293. !
  294. @LABEL 52
  295. settries 1225                    
  296. sbreak                            
  297. pause 80                        
  298. note "A fax call was received but could not be answered."
  299. settries 0
  300. jump 109                        
  301. !
  302. @LABEL 53                        
  303. serreset 57600, 0, 8, 1            
  304.                                 
  305. write "ATO¥13"                
  306. jump 32                            
  307. !
  308. !
  309. @LABEL 58
  310. pause 50
  311. ! turn on cts handshaking.
  312. HSReset 0 1 0 0 0 0
  313. !
  314. pause 30
  315. exit 0
  316. !
  317. ! @ANSWER
  318. ! Set the modem to answer on 1st ring - label range is 61-70
  319. !
  320. @LABEL 62
  321. matchclr
  322. matchstr 1 32 "OK¥13¥10"
  323. matchstr 2 63 "ERROR¥13¥10"
  324. write "AT+FAE=1S0=1¥13"            
  325. matchread 30
  326. !
  327. @LABEL 63
  328. matchclr
  329. matchstr 1 32 "OK¥13¥10"
  330. write "ATS0=1¥13"                
  331. matchread 30
  332. jump 71
  333. !
  334. ! error messages - label range is 71-100
  335. !
  336. ! Modem Not Responding
  337. @LABEL 71
  338. exit -6019
  339. !
  340. ! No Dial Tone
  341. @LABEL 72
  342. exit -6020
  343. !
  344. ! No Carrier or Error
  345. @LABEL 73
  346. exit -6021
  347. !
  348. ! Busy
  349. @LABEL 74
  350. exit -6022
  351. !
  352. ! No Answer
  353. @LABEL 75
  354. exit -6023
  355. !
  356. ! varstring invalid value
  357. @LABEL 76
  358. exit -6027
  359. !
  360. ! Hang up the modem - label range is 101-120
  361. !
  362. @HANGUP
  363. iftries 1225 114                
  364. !
  365. ! serreset 19200, 0, 8, 1        
  366. HSReset 0 0 0 0 0 0
  367. @LABEL 105
  368. !
  369. ! Try to get control of the modem.
  370. !
  371. DTRSet
  372. pause 5
  373. DTRClear
  374. flush
  375. !
  376. @LABEL 108
  377. flush
  378. DTRClear
  379. pause 5
  380. DTRSet
  381. matchclr
  382. matchstr 1 111 "NO CARRIER¥13¥10"
  383. matchstr 2 111 "OK¥13¥10"
  384. matchstr 3 111 "ERROR¥13¥10"
  385. write "ATH¥13"
  386. matchread 30
  387. inctries
  388. iftries 3 71
  389. DTRSet
  390. pause 5
  391. DTRClear
  392. pause 5
  393. DTRSet
  394. flush
  395. !
  396. @LABEL 109
  397. matchclr
  398. matchstr 1 115 "OK¥13¥10"
  399. write "+++"
  400. matchread 15
  401. jump 108
  402. !
  403. ! recall the factory settings.
  404. !
  405. @LABEL 111
  406. pause 15
  407. matchclr
  408. matchstr 1 114 "OK¥13¥10"
  409. matchstr 2 112 "ERROR¥13¥10"
  410. write "AT&F1S0=0¥13"            
  411. matchread 30
  412. jump 71
  413. !
  414. @LABEL 112
  415. matchclr
  416. matchstr 1 114 "OK¥13¥10"
  417. write "AT&FS0=0¥13"
  418. matchread 30
  419. jump 71
  420. !
  421. @LABEL 114
  422. exit 0
  423.  
  424. @LABEL 115
  425. pause 50
  426. jump 108
  427.  
  428. !
  429. ! labels 121-128 are reserved for future emergency hacks
  430. !
  431.